@model Campus.Entities.Estudiante

@{
    ViewBag.Title = "Estudiante";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Nuevo</h2>

@using (Html.BeginForm("Create", "Estudiantes", FormMethod.Post, new { enctype = "multipart/form-data" })) {
    @Html.ValidationSummary(true)
    <fieldset class="form-horizontal">
        <legend>Estudiante</legend>
        @* This partial view defines form fields that will appear when creating and editing entities *@
        @*
                              
		@Html.Partial("_CreateOrEdit", Model)
        *@
               
@Html.Partial("_CreateOrEditAdministradorYResponsable", Model)

@*<div class="control-group">
	<div class="control-label">
    Documentacion
</div>
<div class="controls">
    @Html.DropDownListFor(model => model.DocumentacionId, ((IEnumerable<Campus.Entities.Documentacion>)ViewBag.PossibleDocumentacions).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.DocumentacionId.ToString(),
        Selected = (Model != null) && (option.DocumentacionId == Model.DocumentacionId)
    }), "Elegir...")
    @Html.ValidationMessageFor(model => model.DocumentacionId)
</div>
</div>*@
<div class="control-group">
	<div class="control-label">    
        @Html.LabelFor(m => m.Responsable)
    </div>
<div class="controls">
    @Html.DropDownListFor(model => model.ResponsableId, ((IEnumerable<Campus.Entities.Responsable>)ViewBag.PossibleResponsables)
     .OrderBy(r=>r.Apellido.ToLower()).ThenBy(r=> r.Nombre.ToLower())
     .Select(option => new SelectListItem {
        Text = (option == null ? "None" : string.Format("{0}, {1}", option.Apellido, option.Nombre )), 
        Value = option.ResponsableId.ToString(),
        Selected = (Model != null) && (option.ResponsableId == Model.ResponsableId)
    }), "Elegir...")
    @Html.ValidationMessageFor(model => model.ResponsableId)
</div>
</div>

@Html.Partial("_CreateOrEditAdministrador", Model)

        


        <div class="form-search well">
            <input type="button" id="btnSubmit" class="btn btn-primary" value="Crear" />
		    @Html.ActionLink("Volver a la lista", "Index",null,new{ @class="btn"})
        </div>
    </fieldset>
}


